<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
?>
<div style="width:500px; height:400px">
  <p align="left">用户：<strong><?php echo getUser($uid);?></strong></p>
  <div>
    <form class="form-horizontal" method="post" id="form_add">
    <input name="uid" type="hidden" value="<?php echo $uid;?>" />
    <div class="form-group">
        <label class="col-sm-1 control-label" style="width:100px;">积分类型</label>
        <div class="col-sm-8"> 
            <div class="col-xs-4"><label><input type="radio" name="type" checked="checked" value="0"> 佣金积分</label></div>
            <div class="col-xs-4"><label><input type="radio" name="type" value="1"> 信用积分</label></div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label" style="width:100px;">操作类型</label>
        <div class="col-sm-8"> 
            <div class="col-xs-3"><label><input type="radio" name="act" value="0"><span class="red">扣除</span></label></div>
            <div class="col-xs-3"><label><input type="radio" name="act" checked="checked" value="1">增加</label></div>
        </div>
    </div>
      <div class="form-group">
        <label class="col-sm-1 control-label" style="width:100px;">积分数量</label>
        <div class="col-sm-4">
            <input type="text" id="credit" name="credit" placeholder="必填" data-required="true" class="form-control">
        </div>
    </div>        
      <div class="form-group">
        <label class="col-sm-2 control-label" style="width:100px;">操作说明</label>
        <div class="col-sm-8" id="show-content"> 
          <!---->
          <div id="reply-content-list">
            <textarea class="form-control" id="reply-content" name="content"  style="height:100px"></textarea>
            <p class="help-block">默认内容：管理员操作</p>
          </div>
          <!---->
        </div>
      </div>
      <p></p>
      <p class="btn-group btn-group-justified"><a class="btn btn-success" href="javascript:;" id="send">提交数据</a></p>
      <p></p>
    </form>
  </div>
</div>
<script>
$(function(){
	$('#send').click(function(){
		var credit=$("#credit").val();
		var content=$("#reply-content").val();
		if (!credit){
			Msg.error('积分数量不能为空');
			return false;
		}
		Msg.loading('正在发送...');
		$.post('<?php echo U('credit/post');?>',$("#form_add").serialize(),function(result){
			Msg.hide();
			if (result.status==1){
				Msg.ok('操作成功',function(){jQuery(document).trigger('close.facebox');},1000);	
			}else{
				Msg.error(result.info);	
			}
		},'json');
	  return false;
	})	
})
</script>